abi: use PassMode::Direct even for data types that can be passed as scalar pairs.#437
Merged
eddyb merged 1 commit intoRust-GPU:mainfrom Oct 13, 2025
Merged
Conversation
Firestar99
approved these changes
Oct 13, 2025
Member
Firestar99
left a comment
There was a problem hiding this comment.
Looks good!
I tried rebasing #381 locally and ran into some compiletest disassembly changes, caused both by this PR and the "Erase explicit layout decorations" PR, but all trivial changes. (Next to me forgetting to clear certain target folders)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ideally this change would apply only to
#[rust_gpu::vector::v1]types (as they're the ones which can end up being passed as pairs when they have only 2 components, e.g.glam::{Vec2,IVec2,UVec2}etc.), but checking that from a query override (which is where this logic is right now) isn't exactly trivial.However, I don't expect doing this across the board (i.e. to all
structs andenums that would've gotten passed as two scalar args) to cause any issues, not even performance ones (at least on reasonable drivers).Motivated by (and unlocks):
glamtypes abi layout match CPU #380More specifically, it should remove the dependency on this other PR:
(still want to land that, but it makes more sense as an diagnostic UX improvement, while semantically IMO we should not be decomposing and recomposing vector types just because we're not using
#[repr(simd)]anymore)